var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0}), (o.LingquJiangli = void 0);
var a = t("Const"),
    i = t("Platforms"),
    s = t("Popup"),
    c = t("Sounds"),
    l = cc._decorator,
    u = l.ccclass,
    p =
        (l.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function () {
                    var t = this,
                        e = this.node.getChildByName("container");
                    (this.icon = e.getChildByName("icon")),
                        (this.txt = e.getChildByName("txt").getComponent(cc.Label)),
                        (this.info = e.getChildByName("info").getComponent(cc.Label)),
                        (this.lingqu = e.getChildByName("lingqu")),
                        this.lingqu.on(cc.Node.EventType.TOUCH_END, function () {
                            c.Sounds.playFX("点击"),
                                t.hide(),
                                a.default.addMoney(t.type, t.num, t.info.string, t.icon, null),
                                i.default.userStorage.setDirty();
                        });
                }),
                (e.prototype.set = function (t, e, o, n) {
                    (this.type = t), (this.num = e), (this.txt.string = "x" + this.num), (this.info.string = n);
                    for (var r = -1, a = 0, i = this.icon.children; a < i.length; a++) {
                        r++, (i[a].active = r == o);
                    }
                }),
                (e.prototype.show = function () {
                    t.prototype.show.call(this);
                }),
                (e.prototype.showComplete = function () {
                    t.prototype.showComplete.call(this);
                }),
                (e.prototype.hide = function () {
                    t.prototype.hide.call(this);
                }),
                (e.prototype.hideComplete = function () {
                    t.prototype.hideComplete.call(this);
                }),
                (e = r([u], e))
            );
        })(s.Popup));
o.LingquJiangli = p;
